import subprocess

# TODO: 暂时解决unoconv无法识别 libreoffice 的问题
import os

os.environ['LD_LIBRARY_PATH'] = '/usr/lib/libreoffice/program:' + os.environ.get('LD_LIBRARY_PATH', '')


# 定义文件转换函数
def convert_ppt_to_pptx(input_file_path, output_file_path):
    subprocess.run(['unoconv', '-f', 'pptx', '--output', output_file_path, input_file_path], check=True)


def convert_xls_to_xlsx(input_file_path, output_file_path):
    subprocess.run(['unoconv', '-f', 'xlsx', '--output', output_file_path, input_file_path], check=True)
